/*
 * Phone.java
 *
 * Created on March 18, 2009, 9:21 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package org.vacuela.publish.desktop;

import com.u2d.model.AbstractComplexEObject;
import com.u2d.model.Title;
import com.u2d.type.atom.BooleanEO;
import com.u2d.type.atom.StringEO;
import java.awt.Color;
import org.vacuela.publish.constant.Constant;

/**
 *
 * @author nestor.carrasco
 */
public class Phone extends AbstractComplexEObject {
    private final StringEO _number = new StringEO();
    private final StringEO description = new StringEO();
    
    
    private Contact _contact;
    public static String contactInverseFieldName = "phones";
    public static Color colorCode = new Color(0x6E8B3D);
    public static String[] fieldOrder =   {"number", "contact","active","description"};  
    public final BooleanEO active = new BooleanEO(true);   
    
    public static String[] hidden = {"contact"};
    
    /** Creates a new instance of Phone */
    public Phone() {
    }

    public StringEO getNumber(){
        return _number;
    }
    public Title title() {
        return _number.title().append(" [Active:").append(active).append("] [Desc:").append(description).append("]");
    }
    
    public BooleanEO getActive(){
        return active;
    }
    
   public Contact getContact() { return _contact; }
   public void setContact(Contact newContact)
   {
      Contact oldContact = _contact;
      _contact = newContact;
      firePropertyChange("contact", oldContact, _contact);
   }
    
	public StringEO getDescription(){
		return description;
	}       
        
}
